import { Body, Controller, Get, Post, Req, Res, Session } from '@nestjs/common';
import { CodeService } from './code.service';

@Controller('code')
export class CodeController {
  constructor(private readonly codeService: CodeService) {}

  @Get()
  createCode(@Req() req: Request, @Res() res: Response, @Session() session: Record<string, any>) {
    return this.codeService.createCode(req,res,session);
  }

  @Post()
  verifyCode(@Body() body: {code:string}, @Session() session: Record<string, any>) {
    return this.codeService.verifyCode(body, session)
  }
}
